'use strict';
const Koa = require('koa');
const res = require('koa-static');
const knex = require('./conf/db');
const gzip = require('koa-compress');
const body = require('koa-better-body');

const app = new Koa();

app.use(gzip());
app.use(body());
app.use(res('html', { gzip: true }));

global.uuid = '';
// //加入系统缓存
// require('./cache')(app);
// //加入系统级别日志
app.context.knex = knex;

//程序现在的功能
require('./ctrl/login')(app);
// require('./util/public')(app);
// require('./ctrl/show')(app);
// require('./ctrl/filter')(app);
// require('./ctrl/system')(app);

// require('./ctrl/user')(app);
// require('./ctrl/elect')(app);
// require('./ctrl/download')(app);
// require('./ctrl/expert')(app);
// require('./ctrl/teacher')(app);

// require('./ctrl/college')(app);
// require('./ctrl/subject')(app);
// require('./ctrl/student')(app);
// require('./ctrl/office')(app);
// require('./ctrl/course')(app);

// require('./ctrl/score')(app);
// require('./ctrl/public')(app);
// require('./ctrl/double')(app);
// require('./ctrl/upload')(app);
//
app.listen(4000, () => {
   console.log("Server started")
})